//
//  AFNNetWorkManager.h
//  zjsapp
//  test1
//  Created by 技术部mac1 on 2018/1/4.
//  Copyright © 2018年 njmd. All rights reserved.
//

#import <Foundation/Foundation.h>
#import  <AFNetworking/AFNetworking.h>
#import "Result.h"
#import "ZJSAFmanager.h"


@interface AFNNetWorkManager : NSObject

+(instancetype)shareAFNNetWorkManager;

- (NSURLSessionDataTask *)Post:(NSString *)URLString
parameters:( id)parameters
   success:( void (^)(NSURLSessionDataTask *task, Result *result))success
   failure:( void (^)(NSURLSessionDataTask *  task, NSError *error))failure;

- (NSURLSessionDataTask *)postJson:(NSString *)URLString
parameters:( id)parameters
   success:( void (^)(NSURLSessionDataTask *task, Result *result))success
   failure:( void (^)(NSURLSessionDataTask *  task, NSError *error))failure;

- (NSURLSessionDataTask *)basePost:(NSString *)URLString
            domain:(NSString *)domain
reqeusetSerializer:(AFHTTPRequestSerializer <AFURLRequestSerialization> *)requestSerializer
        parameters:( id)parameters
           success:( void (^)(NSURLSessionDataTask *task, Result *result))success
           failure:( void (^)(NSURLSessionDataTask *  task, NSError *error))failure;

- (NSURLSessionDataTask *)Get:(NSString *)URLString
parameters:( id)parameters
   success:( void (^)(NSURLSessionDataTask *task, Result *result))success
   failure:( void (^)(NSURLSessionDataTask *  task, NSError *error))failure;

- (NSURLSessionDataTask *)getWithDomain:(NSString *)DomainString
                                     url:(NSString *)URLString
                              parameters:( id)parameters
                                 success:( void (^)(NSURLSessionDataTask *task, Result *result))success
                                 failure:( void (^)(NSURLSessionDataTask *  task, NSError *error))failure;

-(NSString *)checkURL;
- (void)addRequestHeaders:(AFHTTPSessionManager *)sessionManager;
@end
